package Text;

import org.jetbrains.annotations.Contract;

public class text20210416_01 {
    public static void main(String[] args) {
        int [] a={3,4,5,1,2};
        int i = minArray(a);
        System.out.println(i);
    }
    static int minArray(int[] numbers) {
        int l=0,r=numbers.length-1;
        while (l<=r){
            if(numbers[(l+r)/2]<numbers[r])
                r=(l+r)/2;
            else if(numbers[(l+r)/2]>numbers[r]){
                l=(l+r)/2+1;
            }else
                r--;
        }
        return numbers[l];
    }
}
